package com.zbkj.dal.entity.order;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author 484
 */
@Data
@TableName("eb_order_rent_payment_record")
public class OrderRentPaymentRecord {
    @ApiModelProperty(value = "分账id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "支付订单号")
    private String payOrderNo;

    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ApiModelProperty("承享记录编号")
    private String rentRecordCode;

    @ApiModelProperty("用户ID")
    private Integer uid;

    @ApiModelProperty(value = "支付交易类型")
    private String payTradeType;

    @ApiModelProperty(value = "订单商品总额")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "积分抵扣金额")
    private BigDecimal integralAmount;

    @ApiModelProperty(value = "逾期金额")
    private BigDecimal overdueAmount;

    @ApiModelProperty(value = "实际支付金额")
    private BigDecimal payAmount;

    @ApiModelProperty(value = "支付时间")
    private LocalDateTime payTime;

    /**
     * @see PayType
     */
    @ApiModelProperty(value = "支付类型: MANUAL_PAYMENT:手动支付， BALANCE_DEDUCTION:自动扣款(雅识)")
    private String payType;

    @ApiModelProperty(value = "支付方式: weixin,alipay,yue")
    private String payMethod;

    @ApiModelProperty(value = "支付渠道：public-公众号,mini-小程序，h5-网页支付,yue-余额，wechatIos-微信Ios，wechatAndroid-微信Android,alipay-支付宝，alipayApp")
    private String payChannel;

    @ApiModelProperty(value = "支付状态：0 未付款 1 已付款")
    private Integer paidStatus;

    @ApiModelProperty(value = "退款状态：0 未退款 1 申请中 2 部分退款 3 已退款")
    private Integer refundStatus;

    @ApiModelProperty(value = "商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号")
    private String outTradeNo;

    @ApiModelProperty(value = "支付重定向地址")
    private String redirect;

    @ApiModelProperty(value = "是否删除")
    private Integer isDel;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    public enum PayTradeType {

        // 承享订单超期自动雅识抵扣
        OVERDUE_DEDUCTION_AUTO,

        // 承享订单延长支付
        RENT_ORDER_PROLONG

    }

    public enum PayType {

        // 手动支付
        MANUAL_PAYMENT,

        // 雅识自动扣款
        BALANCE_DEDUCTION

    }
}
